<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        .box{
            /* 控制列数 */
            column-count: 4;
            /* 控制列间隙 */
            column-gap: 30px;
            max-width: 1200px;
            margin: 30px auto;
            border: 1px solid red;
        }
        .item{
            height: 150px;
            line-height: 150px;
            background-color: pink;
            text-align: center;
            margin-bottom: 30px;
            /* 不允许盒子跨栏 */
            break-inside: avoid-column;
            border-radius: 10px;
        }
        .item:nth-child(2){
            height: 300px;
            line-height: 300px;
        }
        .item:nth-child(3){
            height: 200px;
            line-height: 200px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item">
            1
        </div>
        <div class="item">
            2
        </div>
        <div class="item">
            3
        </div>
        <div class="item">
            4
        </div>
        <div class="item">
            5
        </div>
        <div class="item">
            6
        </div>
        <div class="item">
            7
        </div>
        <div class="item">
            8
        </div>
        <div class="item">
            9
        </div>
        <div class="item">
            10
        </div>
        <div class="item">
            11
        </div>
        <div class="item">
            12
        </div>
        <div class="item">
            13
        </div>
    </div>
</body>
</html>